﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

namespace Chronos.Presentation
{
    public class MainViewModel
    {
        public DelegateCommand AddCommand { get; private set; }
        public string ItemToAdd { get; set; }
        public ObservableCollection<string> ItemList { get; set; }

        public MainViewModel()
        {
            AddCommand = new DelegateCommand(AddToListHandler);
            ItemList = new ObservableCollection<string>();
        }

        private void AddToListHandler(object sender, SimpleCommandEventArgs e)
        {
            if (!string.IsNullOrEmpty(ItemToAdd))
                ItemList.Add(ItemToAdd);
        }
    }
}
